<?php  // We define some important div to the page desing. Definimos varios div claves para el diseño de la pagina.
// If the session variable "is_logged_in" is not defined, it won't show anything more, because you've to be logged in to see the rest of the menu.
// Si la variable de sesión "is_logged_in" no está definida, no se mostrará nada más ya que se ha de ser administrador para poder ver cualquier menú en la pagina según los requerimientos del proyecto.

if (!isset($_SESSION['is_logged_in']))
{
	echo "<h2><u>Welcome to the Sjo-regatta project page</u></h2><br /><p>The goal of this project is to develop a web application to manage the score of a set of regattas, being each a series of boat regatta races.<br /><br /> Sjo-regatta allows tasks such as set new participants, set new regattas, record the points of the races and see the results of those races.<br /><br /> But to do this you must be REGISTERED in our database. If you're not, I'm afraid your road comes to an end here. If instead you are registered in our database, in the top bar, in the right part, you can log-in to access all the services described above.</p>
	<div id='content'>";
	include 'footer.php';
	exit;
}

else { // If the session variable is_logged_in is defined, we can see the entire menu. Si la variable si está definida, podremos ver el menu entero.

	echo "<ul>
	<li><a ";
	if ($final=="newparticipant_impl.php")
	{
		echo "class='selected' "; // If the "final" variable matches with the actual php file, we add a class to show in which section are we. Si la variable final coincide con el php actual en el que estamos, se remarca la seccion en el menu para mostrarnos donde nos encontramos.
	}
	echo "href='newparticipant_impl.php'>New Participant</a></li>

	<li><a ";
	if ($final=="newregatta_impl.php")
	{
		echo "class='selected' ";
	}
	echo "href='newregatta_impl.php'>New Regatta</a></li>


	<li><a ";
	if ($final=="registerpoints_impl.php")
	{
		echo "class='selected' ";
	}
	echo "href='registerpoints_impl.php'>Register Points</a></li>

	<li><a ";
	if ($final=="viewresults_impl.php")
	{
		echo "class='selected' ";
	}
	echo "href='viewresults_impl.php'>Regatta Results</a></li>
	</ul>";
}

echo "<div id='content'>"; 
?>